/*!
 * Clippy jQuery plugin v.2
 *
 * licensed under the MIT License (see LICENSE file).
 * 
 * Clippy:
 * @autor mojombo
 * @url https://github.com/mojombo/clippy
 * 
 * Plugin:
 * @autor 4031651
 * @url http://w3maker.name/js/clippy-jquery-plugin.html
 *
 * Date: 2001.08.01(Y.m.d)
 */
jQuery.fn.clippy = function(options) {
	var settings = jQuery.extend({
		source: null,
		id: 'clippy',
		name: 'clippy',
		sfwUrl: 'flash/clippy.swf',
		text: 'clippy',
		bgcolor: '#ffffff'
	}, options)
	
	var $source = jQuery(settings.source)
	var text = $source.val() || $source.text() || settings.text

	var clippy = jQuery('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\
	width="110"\
	height="14"\
	id="'+ settings.id +'" >\
		<param name="movie" value="'+ settings.sfwUrl +'"/>\
		<param name="allowScriptAccess" value="always" />\
		<param name="quality" value="high" />\
		<param name="scale" value="noscale" />\
		<param NAME="FlashVars" value="text='+ text +'">\
		<param name="bgcolor" value="'+ settings.bgcolor +'">\
		<embed src="'+ settings.sfwUrl +'"\
			width="110"\
			height="14"\
			name="'+ settings.name +'"\
			quality="high"\
			allowScriptAccess="always"\
			type="application/x-shockwave-flash"\
			pluginspage="http://www.macromedia.com/go/getflashplayer"\
			FlashVars="text='+ text +'"\
			bgcolor="'+ settings.bgcolor +'"\
		/>\
</object>')

	this.each(function() {
		jQuery(this).append(clippy)
	})
	return this
}